<?php
	include("global.php");
	$categorys_temp = $db->findall('category');

while ($row = $db->fetch_array($categorys_temp)) {
    $categorys[$row['id']] = $row['typename'];
}

if(isset($_POST['submit']))
{	
        $gongsiname = $_POST['gongsiname'];
        $user= $_POST['user'];
        $type = $_POST['type'];
        $email = $_POST['email'];
        $address = $_POST['address'];
        $tel = $_POST['tel'];
        $des = $_POST['des'];
		$fujian = "";
		if (is_uploaded_file($_FILES['fujian']['tmp_name'])){
			$upfile=$_FILES["fujian"];

			$names = $upfile["name"];
			$type = $upfile["type"];
			$size = $upfile["size"];
			$tmp_name = $upfile["tmp_name"];
			$error = $upfile["error"];


			switch ($type) {
				case 'image/pjpeg' : $ok=1;
					break;
				case 'image/jpeg' : $ok=1;
					break;
				case 'image/gif' : $ok=1;
					break;
				case 'image/png' : $ok=1;
					break;
			}
			
			if($ok && $error=='0'){
				move_uploaded_file($tmp_name,'images/'.$names);
			}
			$fujian = $names;
		}
    
	$name = 'gongsiname,user,type,email,address,des,tel,fujian';
        $values = $gongsiname."','" .$user."','" .$type."','" .$email."','" .$address."','" .$des."','".$tel."','".$fujian;
	
	$db->insert('yuyue',$name,$values);
	$db->Get_admin_msg("index.php");
}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link href="css/main.css" rel="stylesheet" type="text/css" />
<link href="css/div.css" rel="stylesheet" type="text/css" />
<script src="js/jquery.js" language="javascript" type="text/javascript"></script>
<script src="js/jquery-1.4.2.js" language="javascript" type="text/javascript"></script>
<script src="js/secondmenu.js" language="javascript" type="text/javascript"></script>
<style type="text/css">
.pages { height:25px; overflow:hidden; text-align:center; line-height:25px; font-family:Verdana; }
.pages a, .pages strong { margin:0 1px; padding:2px 6px; border:1px solid #E4E4E4; text-decoration:none!important; }
.pages a:hover { border-color:#369; color:369 }
.backs { border-color:#369; background:#369; color:#FFF; }
.pages .prev { padding:4px 6px 2px 20px!important; padding:4px 6px 0 20px; background:url(images/arrow_left.gif) no-repeat 9% 50%; font-family:simsun; }
.next { padding:4px 20px 2px 6px!important; padding:4px 20px 0 6px; background:url(images/arrow_right.gif) no-repeat 91% 50%; font-family:simsun; }
</style>
<script type="text/javascript">
	$(function(){
		$("#fenye a").click( function() {
			$(this).addClass("backs");
		});
	});	 
</script>


</head>
<?php
	include("conn/conn.php");
?>
<body>
<div class="box1">
	<?php include("top.php"); ?>
		<embed src="diy/pics/20100623/1.swf" width="1002" height="254" style="position: absolute; left: 18%; top: 130px;"  quality="high" wmode="transparent"  />
			<img src="diy/pics/20100623/huiyuanzhongxin.jpg" border="0" width="1002" />
		  </div>
		</div>
		<div style=" height:10px;">&nbsp;</div>
		
	<div style=" height:20px;">&nbsp;</div>
	<div style=" width:1003px;">
		<div style=" width:200px; overflow:hidden; float:left;">
			
			<?php
				include("ordertree.php");
				include("search.php");
			?>
		</div>
		<div style="float:left; width:50px;">&nbsp;</div>
		<div style=" float:left; width:750px;">
			<div style=" width: 750px; background-color:#8DBAE0; height:5px;"></div>
			<div style=" width:200px; height:15px;">&nbsp;</div>
			<div style=" width:750px; height:20px;">
				<span style=" float:left; text-align:left;color:#768DC1; font-size:15px; font-weight:bolder; height:30px;">
					商务预约
				</span><span style=" float:right;text-align:right" id="span1"><a href="index.php">首页</a>-><a href="order.php">会员中心</a>-><a href="reservation.php">商务预约</a></span>
			</div>
			<div style=" height:10px;">&nbsp;</div>
			<div style=" width:750px; text-align:left;">
			<script src="base/js/jquery.validate.min.js"></script>
			<script>
			$(function() {
			// validate signup form on keyup and submit
				$("#form1").validate({
					rules: {
						gongsiname: "required",
						tel: "required",
									user:'required',
									address:"required",
						password: {
							required: true,
							minlength: 6
						},
						compassword: {
							required: true,
							minlength: 6,
							equalTo: "#password"
						},
						email: {
							required: true,
							email: true
						}
					},
					messages: {
						user:"联系人不能为空",
						gongsiname: "预约客户不能为空",
						tel: "公司电话不能为空",
						address: "公司地址不能为空",
						tel: "公司电话不能为空",
						email:{
							required: "邮箱不能为空",
							email: "邮箱格式不正确"
						}
					}
				});
			})
			</script>
                <form action="reservation.php" method="post" enctype="multipart/form-data" id="form1">
				<br />
			 <p><span style="color:red;">*</span>预约客户：<input name="gongsiname"  id="gongsiname" type="text" value="" style="width:260px; height:20px; border-bottom:1px solid #aaa" class="inputproduct"> </p>
			 <br />
			 <p><span style="color:red;">*</span>服务类型：
				<select name="type">
					<option value ="商务洽谈">  商务洽谈</option>
					<option value ="投资洽谈">  投资洽谈</option>
					<option value ="其他">  其他</option>
				</select>
			 </p>
			 <br />
			 <p><span style="color:red;">*</span>&nbsp;&nbsp;联 系 人：<input name="user"  id="user" type="text" value="" style="width:260px; height:20px; border-bottom:1px solid #aaa" class="inputproduct" /></p><br />
			 <p><span style="color:red;">*</span>邮箱地址：<input name="email" id="email" type="text" value="" style="width:260px; height:20px; border-bottom:1px solid #aaa" class="inputproduct" /></p><br />
			 <p> <span style="color:red;">*</span>公司地址：<input name="address" id="address"  type="text" value="" style="width:260px; height:20px; border-bottom:1px solid #aaa" class="inputproduct" /></p>  <br />
			 <p><span style="color:red;">*</span>联系电话：<input name="tel" id="tel" type="text" value="" style="width:260px; height:20px; border-bottom:1px solid #aaa" class="inputproduct" /></p><br />
			 <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;附&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;件：<input name="fujian" id="fujian" type="file" style="width:260px; height:20px; border-bottom:1px solid #aaa" class="inputproduct" /></p><br />
			 <div style="float:left">&nbsp;&nbsp;详细说明：&nbsp;</div><div style=" float:left"><textarea rows="6" cols="30" name="des" style=" border:1px solid #aaa"></textarea></div>
			 <div style="clear:both; height:20px;"></div>
			 <br />
			 <div style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input class="submit1" type="submit" value="提交" name="submit" style="width:60px; height:25px;"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input class="reset" type="reset" value="重置" name="reset" style="width:60px; height:25px;"/></div>
		</form>
		 <br />
		 <br />
		 <br />
			</div>
		</div>
	</div>

	<?php
		include("foot.php");
	?>
</div>
</body>
</html>

